<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>all并行异步操作</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
	 
</style>
</head>
<body>
	<h1>aaaa</h1>
	<div id="box">
	    <h2>all并行异步操作 setTimeout</h2>
  </div>
</body>
<script src="index.js"></script>
<script type="text/javascript"> 


console.time('aaa')

const hdcms = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve("第一个Promise");
  }, 2000);
});
const houdunren = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve("第二个异步");
  }, 1800);
});

const hd = Promise.all([hdcms, houdunren])
  .then(results => {
    console.timeEnd('aaa')

    console.log(results);
  })
  .catch(msg => {
    console.log(msg);
  });

</script>
</html>